﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lamex.mIE.Calculate
{
    public class LGC_VAL_D34
    {      
        /// <summary>
        /// 计算D34工时
        /// </summary>
        /// <param name="dr1">特征输入值-IE_Part_FeatureList</param>
        /// <param name="dr2">特征单位工时/附加工时-IE_Feature_Definatian</param>
        /// <param name="dr3">尺寸参数-IE_Part_SizeParmList</param>
        /// <param name="Types"></param>
        /// <param name="Thickness"></param>
        /// <returns></returns>
        public static double GetD34(DataRow[] dr1, DataRow[] dr2, DataRow[] dr3)
        {
            double TD34 = 0, Tfb = 0, Tbc = 0, Tw1 = 0, Tw2 = 0, Td1 = 0,
                Td2 = 0, Lcd = 0, Tdz = 0, Tpj = 0, Twqk = 0, Tnqk = 0, Txb = 0, Tqx = 0, Tqf = 0, Tld = 0, Nrs = 0;
            string Types = "", Thickness = "";
            double TD34_Coefficient_Width_W1 = 0;//系数阔度W1
            double TD34_Coefficient_Width_W2 = 0;//系数阔度W2
            double TD34_Coefficient_Depth_D1 = 0;//系数深度D1
            double TD34_Coefficient_Depth_D2 = 0;//系数深度D2
            double TD34_Coefficient_Angle_Z = 0;//系数转角Z
            double TD34_Copper_Head_Plug = 0;//D34_打铜头胶塞
            double TD34_Twisted_Tooth_Nut = 0;//D34_拧带齿螺母
            double TD34_Groove_Side_Rubbing = 0;//D34_槽侧边擦色
            double TD34_LOGO = 0;//D34_贴美时LOGO
            double TD34_Mounting_Screen_Hanging_Code = 0;//D34_装屏风挂码
            double TD34_Inside_the_Seal_700 = 0;//D34_封内缺700
            double TD34_Inside_the_Seal_701 = 0;//D34_封内缺701
            double TD34_Seal_Outer_Ear_200 = 0;//D34_封外耳200
            double TD34_Seal_Outer_Ear_400 = 0;//D34_封外耳400
            double TD34_Seal_Outer_Ear_401 = 0;//D34_封外耳401
            double TD34_Outside_Seal_300 = 0;//D34_封外缺300
            double TD34_Outside_Seal_500 = 0;//D34_封外缺500
            double TD34_Outside_Seal_501 = 0;//D34_封外缺501
            double TD34_Decorative_Hole_Cover = 0;//D34_装装饰孔盖
            double TD34_Lock_Self_Tapping_Screw = 0;//锁自攻螺丝
            double TD34_General_Label = 0;//贴通用标签
            double TD34_Paste_White_Adhesive_Paper = 0;//贴白色胶纸
            double TD34_Double_Sided_Adhesive_Paper = 0;//贴双面胶纸

            //单位工时
            double WD34_Coefficient_Width_W1 = 0;//系数阔度W1
            double WD34_Coefficient_Width_W2 = 0;//系数阔度W2
            double WD34_Coefficient_Depth_D1 = 0;//系数深度D1
            double WD34_Coefficient_Depth_D2 = 0;//系数深度D2
            double WD34_Coefficient_Angle_Z = 0;//系数转角Z
            double WD34_Copper_Head_Plug = 0;//D34_打铜头胶塞
            double WD34_Twisted_Tooth_Nut = 0;//D34_拧带齿螺母
            double WD34_Groove_Side_Rubbing = 0;//D34_槽侧边擦色
            double WD34_LOGO = 0;//D34_贴美时LOGO
            double WD34_Mounting_Screen_Hanging_Code = 0;//D34_装屏风挂码
            double WD34_Inside_the_Seal_700 = 0;//D34_封内缺700
            double WD34_Inside_the_Seal_701 = 0;//D34_封内缺701
            double WD34_Seal_Outer_Ear_200 = 0;//D34_封外耳200
            double WD34_Seal_Outer_Ear_400 = 0;//D34_封外耳400
            double WD34_Seal_Outer_Ear_401 = 0;//D34_封外耳401
            double WD34_Outside_Seal_300 = 0;//D34_封外缺300
            double WD34_Outside_Seal_500 = 0;//D34_封外缺500
            double WD34_Outside_Seal_501 = 0;//D34_封外缺501
            double WD34_Decorative_Hole_Cover = 0;//D34_装装饰孔盖 
            double WD34_Lock_Self_Tapping_Screw = 0;//锁自攻螺丝
            double WD34_General_Label = 0;//贴通用标签
            double WD34_Paste_White_Adhesive_Paper = 0;//贴白色胶纸
            double WD34_Double_Sided_Adhesive_Paper = 0;//贴双面胶纸
            //附加工时
            double AD34_Coefficient_Width_W1 = 0;//系数阔度W1
            double AD34_Coefficient_Width_W2 = 0;//系数阔度W2
            double AD34_Coefficient_Depth_D1 = 0;//系数深度D1
            double AD34_Coefficient_Depth_D2 = 0;//系数深度D2
            double AD34_Coefficient_Angle_Z = 0;//系数转角Z
            double AD34_Copper_Head_Plug = 0;//D34_打铜头胶塞
            double AD34_Twisted_Tooth_Nut = 0;//D34_拧带齿螺母
            double AD34_Groove_Side_Rubbing = 0;//D34_槽侧边擦色
            double AD34_LOGO = 0;//D34_贴美时LOGO
            double AD34_Mounting_Screen_Hanging_Code = 0;//D34_装屏风挂码
            double AD34_Inside_the_Seal_700 = 0;//D34_封内缺700
            double AD34_Inside_the_Seal_701 = 0;//D34_封内缺701
            double AD34_Seal_Outer_Ear_200 = 0;//D34_封外耳200
            double AD34_Seal_Outer_Ear_400 = 0;//D34_封外耳400
            double AD34_Seal_Outer_Ear_401 = 0;//D34_封外耳401
            double AD34_Outside_Seal_300 = 0;//D34_封外缺300
            double AD34_Outside_Seal_500 = 0;//D34_封外缺500
            double AD34_Outside_Seal_501 = 0;//D34_封外缺501
            double AD34_Decorative_Hole_Cover = 0;//D34_装装饰孔盖
            double AD34_Lock_Self_Tapping_Screw = 0;//锁自攻螺丝
            double AD34_General_Label = 0;//贴通用标签
            double AD34_Paste_White_Adhesive_Paper = 0;//贴白色胶纸
            double AD34_Double_Sided_Adhesive_Paper = 0;//贴双面胶纸

            //获取单位工时和附加工时
            foreach (var drHours in dr2)
            {
                switch (drHours["FEATURE_NAME"].ToString())
                {
                    case "D34_系数阔度W1":
                        WD34_Coefficient_Width_W1 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Width_W1 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_系数阔度W2":
                        WD34_Coefficient_Width_W2 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Width_W2 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_系数深度D1":
                        WD34_Coefficient_Depth_D1 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Depth_D1 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_系数深度D2":
                        WD34_Coefficient_Depth_D2 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Depth_D2 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_系数转角Z":
                        WD34_Coefficient_Angle_Z = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Coefficient_Angle_Z = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_封内缺700":
                        WD34_Inside_the_Seal_700 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Inside_the_Seal_700 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_封内缺701":
                        WD34_Inside_the_Seal_701 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Inside_the_Seal_701 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_封外耳200":
                        WD34_Seal_Outer_Ear_200 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Seal_Outer_Ear_200 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_封外耳400":
                        WD34_Seal_Outer_Ear_400 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Seal_Outer_Ear_400 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_封外耳401":
                        WD34_Seal_Outer_Ear_401 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Seal_Outer_Ear_401 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_封外缺300":
                        WD34_Outside_Seal_300 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Outside_Seal_300 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_封外缺500":
                        WD34_Outside_Seal_500 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Outside_Seal_500 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "D34_封外缺501":
                        WD34_Outside_Seal_501 = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Outside_Seal_501 = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_擦槽边上色":
                        WD34_Groove_Side_Rubbing = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Groove_Side_Rubbing = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_打铜头胶塞":
                        WD34_Copper_Head_Plug = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Copper_Head_Plug = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_拧带齿螺母":
                        WD34_Twisted_Tooth_Nut = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Twisted_Tooth_Nut = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_贴美时LOGO":
                        WD34_LOGO = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_LOGO = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_装屏风挂码":
                        WD34_Mounting_Screen_Hanging_Code = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Mounting_Screen_Hanging_Code = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_装装饰孔盖":
                        WD34_Decorative_Hole_Cover = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Decorative_Hole_Cover = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_贴通用标签":
                        WD34_General_Label = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_General_Label = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_贴白色胶纸":
                        WD34_Paste_White_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Paste_White_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_锁自攻螺丝":
                        WD34_Lock_Self_Tapping_Screw = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Lock_Self_Tapping_Screw = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                    case "Dxx_贴双面胶纸":
                        WD34_Double_Sided_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drHours["UNIT_WORKHOURS"].ToString()) ? "0" : drHours["UNIT_WORKHOURS"].ToString());//单位工时
                        AD34_Double_Sided_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drHours["ATTACH_WORKHOURS"].ToString()) ? "0" : drHours["ATTACH_WORKHOURS"].ToString());//附加工时
                        break;
                }
            }
            //获取特征输入值
            foreach (var drData in dr1)
            {
                switch (drData["FEATURE_NAME"].ToString())
                {
                    case "D34_系数阔度W1":
                        TD34_Coefficient_Width_W1 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());//系数阔度W1
                        break;
                    case "D34_系数阔度W2":
                        TD34_Coefficient_Width_W2 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_系数深度D1":
                        TD34_Coefficient_Depth_D1 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_系数深度D2":
                        TD34_Coefficient_Depth_D2 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_系数转角Z":
                        TD34_Coefficient_Angle_Z = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_封内缺700":
                        TD34_Inside_the_Seal_700 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_封内缺701":
                        TD34_Inside_the_Seal_701 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_封外耳200":
                        TD34_Seal_Outer_Ear_200 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_封外耳400":
                        TD34_Seal_Outer_Ear_400 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_封外耳401":
                        TD34_Seal_Outer_Ear_401 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_封外缺300":
                        TD34_Outside_Seal_300 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_封外缺500":
                        TD34_Outside_Seal_500 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_封外缺501":
                        TD34_Outside_Seal_501 = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_擦槽边上色":
                        TD34_Groove_Side_Rubbing = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_打铜头胶塞":
                        TD34_Copper_Head_Plug = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_拧带齿螺母":
                        TD34_Twisted_Tooth_Nut = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_贴美时LOGO":
                        TD34_LOGO = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_装屏风挂码":
                        TD34_Mounting_Screen_Hanging_Code = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_装装饰孔盖":
                        TD34_Decorative_Hole_Cover = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_贴通用标签":
                        TD34_General_Label = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_贴白色胶纸":
                        TD34_Paste_White_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_锁自攻螺丝":
                        TD34_Lock_Self_Tapping_Screw = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "Dxx_贴双面胶纸":
                        TD34_Double_Sided_Adhesive_Paper = double.Parse(string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "0" : drData["FEAT_VALUE"].ToString());
                        break;
                    case "D34_部件类型":
                        Types = string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "" : drData["FEAT_VALUE"].ToString();
                        break;
                    case "D34_胶边厚度":
                        Thickness = string.IsNullOrEmpty(drData["FEAT_VALUE"].ToString()) ? "" : drData["FEAT_VALUE"].ToString();
                        break;
                }

            }
            //获取长宽高
            foreach (var drsize in dr3)
            {
                Tw1 = double.Parse(string.IsNullOrEmpty(drsize["WIDTH_1"].ToString()) ? "0" : drsize["WIDTH_1"].ToString());//W1
                Tw2 = double.Parse(string.IsNullOrEmpty(drsize["WIDTH_2"].ToString()) ? "0" : drsize["WIDTH_2"].ToString());//w2
                Td1 = double.Parse(string.IsNullOrEmpty(drsize["DEPTH_1"].ToString()) ? "0" : drsize["DEPTH_1"].ToString());//d1
                Td2 = double.Parse(string.IsNullOrEmpty(drsize["DEPTH_2"].ToString()) ? "0" : drsize["DEPTH_2"].ToString());//d2

            }
            //获取配件工时和缺口工时
            Tpj = WD34_Twisted_Tooth_Nut * TD34_Twisted_Tooth_Nut + WD34_Copper_Head_Plug * TD34_Copper_Head_Plug + WD34_Lock_Self_Tapping_Screw * TD34_Lock_Self_Tapping_Screw;
            Twqk = WD34_Seal_Outer_Ear_200 * TD34_Seal_Outer_Ear_200 + WD34_Seal_Outer_Ear_400 * TD34_Seal_Outer_Ear_400 + WD34_Seal_Outer_Ear_401 * TD34_Seal_Outer_Ear_401
                  + WD34_Outside_Seal_300 * TD34_Outside_Seal_300 + WD34_Outside_Seal_500 * TD34_Outside_Seal_500 + WD34_Outside_Seal_501 * TD34_Outside_Seal_501;
            Tnqk = WD34_Inside_the_Seal_700 * TD34_Inside_the_Seal_700 + WD34_Inside_the_Seal_701 * TD34_Inside_the_Seal_701;
            Tqf = WD34_Groove_Side_Rubbing * TD34_Groove_Side_Rubbing + WD34_LOGO * TD34_LOGO + WD34_Mounting_Screen_Hanging_Code * TD34_Mounting_Screen_Hanging_Code
                + WD34_Decorative_Hole_Cover * TD34_Decorative_Hole_Cover + WD34_General_Label * TD34_General_Label + WD34_Paste_White_Adhesive_Paper * TD34_Paste_White_Adhesive_Paper
                + WD34_Double_Sided_Adhesive_Paper * TD34_Double_Sided_Adhesive_Paper;

            switch (Types + Thickness)
            {
                #region L台或类似+2厚度
                case "L台或类似2":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12 * (TD34_Coefficient_Width_W1 + TD34_Coefficient_Width_W2 + TD34_Coefficient_Depth_D1 + TD34_Coefficient_Depth_D2 + TD34_Coefficient_Angle_Z);
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * ((Tw1 * Tw2) - (Tw1 - Td1) * (Tw2 - Td2)) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 圆台+2厚度
                case "圆台2":
                    Lcd = 3.14 * Tw1;
                    Tdz = 0;
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15 + 85;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2 * 0.785) + 35 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 仅1弧1接口+2厚度
                case "仅1弧1接口2":
                    Lcd = 2 * (Tw1 + Tw2);
                    Tdz = 0;
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15 + 85;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 35 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 仅1弧1接口+0.6厚度
                case "仅1弧1接口0.6":
                    Lcd = 2 * (Tw1 + Tw2);
                    Tdz = 0;
                    //封边工时(Tfb)
                    Tfb = Lcd * 0.06 + 30 + Tdz;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = Lcd * 0 + 0 + 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 35 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    break;
                #endregion
                #region 3直带弧+2厚度
                case "3直带弧2":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 0;
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 3直带弧+0.6厚度
                case "3直带弧0.6":
                    // Lcd = 2 * (Tw1 + Tw2);
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 0;
                    //封边工时(Tfb)
                    Tfb = Lcd * 0.02 + 30 + Tdz;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = Lcd * 0 + 0 + 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    break;
                #endregion
                #region 2直带弧+2厚度
                case "2直带弧2":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12;
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 2直带弧+0.6厚度
                case "2直带弧0.6":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12;
                    //封边工时(Tfb)
                    Tfb = Lcd * 0.02 + 30 + Tdz;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = Lcd * 0 + 0 + 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    break;
                #endregion
                #region 1直带弧+2厚度
                case "1直带弧2":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12 * (TD34_Coefficient_Width_W1 + TD34_Coefficient_Width_W2 + TD34_Coefficient_Depth_D1 + TD34_Coefficient_Depth_D2 + TD34_Coefficient_Angle_Z);
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 1直带弧+0.6厚度
                case "1直带弧0.6":
                    // Lcd = 12 * (TD34_Coefficient_Width_W1 + TD34_Coefficient_Width_W2 + TD34_Coefficient_Depth_D1 + TD34_Coefficient_Depth_D2 + TD34_Coefficient_Angle_Z);
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 0;
                    //封边工时(Tfb)
                    Tfb = Lcd * 0.02 + 30 + Tdz;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = Lcd * 0 + 0 + 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    break;
                #endregion
                #region 全弧(4边或3边)+2厚度
                case "全弧(4边或3边)2":
                    Lcd = 2 * (Tw1 + Tw2);
                    Tdz = 86;
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 50 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 120台+2厚度
                case "120台2":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 12 * (TD34_Coefficient_Width_W1 + TD34_Coefficient_Width_W2 + TD34_Coefficient_Depth_D1 + TD34_Coefficient_Depth_D2 + TD34_Coefficient_Angle_Z);
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 + Tw2 - (0.577 * Td1)) * Td1 + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 4边以上不分直弧边+2厚度
                case "4边以上不分直弧边2":
                    Lcd = Tw1 * TD34_Coefficient_Width_W1 + Tw2 * TD34_Coefficient_Width_W2 + Td1 * TD34_Coefficient_Depth_D1 + Td2 * TD34_Coefficient_Depth_D2 + ((Tw1 + Tw2) - (Td1 + Td2)) * TD34_Coefficient_Angle_Z;
                    Tdz = 80;
                    //封边工时(Tfb)
                    if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz;
                    }
                    else
                    {
                        Tfb = (Lcd * 0.017) + 60 + Tdz - (Tpj / 2);
                    }
                    //补充工时(Tbc)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tbc = Twqk + Tpj;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tbc = Tnqk + Tpj;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tbc = Tnqk + Twqk;
                    }
                    else
                    {
                        Tbc = Tnqk + Twqk + Tpj;
                    }
                    //修边工时(Txb)
                    Txb = Lcd * 0.028 + 15;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //离岛工时(Tld)
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Tld = Tnqk;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Tld = Twqk;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Tld = Tpj;
                    }
                    else
                    {
                        Tld = 0;
                    }
                    //配置人数Nrs
                    if (TD34_Inside_the_Seal_700 + TD34_Inside_the_Seal_701 > 0)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Seal_Outer_Ear_200 + TD34_Seal_Outer_Ear_400 + TD34_Seal_Outer_Ear_401 + TD34_Outside_Seal_300 + TD34_Outside_Seal_500 + TD34_Outside_Seal_501 >= 3)
                    {
                        Nrs = 7;
                    }
                    else if (TD34_Copper_Head_Plug + TD34_Twisted_Tooth_Nut >= 30)
                    {
                        Nrs = 7;
                    }
                    else
                    {
                        Nrs = 6;
                    }
                    //Total 工时
                    TD34 = Maximum(Tfb + Tbc, Txb, Tqx, Tld) * Nrs;
                    break;
                #endregion
                #region 轮廓不封边+0厚度
                case "轮廓不封边0":
                    Tdz = 0;
                    //封边工时(Tfb)
                    Tfb = 0;
                    //补充工时(Tbc)
                    Tbc = Tnqk + Twqk;
                    //修边工时(Txb)
                    Txb = 0;
                    //清洗工时(Tqx)
                    Tqx = 0.000085 * (Tw1 * Tw2) + 15 + Tqf;
                    //配置人数Nrs
                    Nrs = 4;
                    //Total 工时
                    if (Tfb + Tbc == 0)
                    {
                        TD34 = Tpj + (Tqx * Nrs / 2);
                    }
                    else
                    {
                        TD34 = (NumMAX(Tfb + Tbc, Tpj) + Tqx) * Nrs / 2;
                    }

                    break;
                    #endregion
            }
            return TD34;
        }

          
        //四个数取最大值
        public static double Maximum(double x, double y, double z, double h)
        {
            double maximumValue = x;
            if (y > maximumValue)
                maximumValue = y;
            if (z > maximumValue)
                maximumValue = z;
            if (h > maximumValue)
                maximumValue = h;
            return maximumValue;
        }
        //二个数取最大值
        private static double NumMAX(double Tw1, double Tw2)
        {
            if (Tw1 > Tw2)
            {
                return Tw1;
            }
            return Tw2;
        }
    }
}
